package com.study.config;

import com.study.interecptor.RepeatSubmitInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 重复提交拦截器配置
 *
 * @Author hupengming
 * @ClassName
 * @Date 2022-11-11 17:41
 * @Version 1.0
 */
@Component
public class RepeatInterceptorConfig implements WebMvcConfigurer {

    @Autowired
    RepeatSubmitInterceptor repeatSubmitInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/sa/**");
    }
}
